Skip to content

Conversation

@wesleywright
Copy link
Contributor

Small quality of life improvement. For some use cases (such as writing tests), it is common to want to check if a given GTID set is empty or not. Currently this requires using Equal() with an empty GTID set (which takes a decent amount of boilerplate) or else requires inspecting the Set field (which is specific to a single concrete implementation of the GTIDSet interface).

This commits adds a simple IsEmpty() bool method to the GTIDSet interface for this use case, as well as implementations for both MysqlGTIDSet and MariadbGTIDSet.

@wesleywright
Copy link
Contributor Author

This is my first contribution to this repo; it seemed like a pretty small and straightforward change so I thought it was simplest to directly submit it as a PR. I'm happy to take any feedback on it :-)

@lance6716 lance6716 merged commit 639eccd into go-mysql-org:master Mar 29, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants